Class HeapNodeFG

  • All Implemented Interfaces:
    java.lang.Comparable<HeapNodeFG>
    Direct Known Subclasses:
    IndexedHeapNode

    public class HeapNodeFG
    extends java.lang.Object
    implements java.lang.Comparable<HeapNodeFG>
    Author:
    César Martín Pavón
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static double EPSILON  
      private int j  
      private double Q  
    • Constructor Summary

      Constructors 
      Constructor Description
      HeapNodeFG​(int j, double q)  
    • Field Detail

      • j

        private int j
      • Q

        private double Q
    • Constructor Detail

      • HeapNodeFG

        public HeapNodeFG​(int j,
                          double q)
    • Method Detail

      • getJ

        public int getJ()
        Returns:
        the j
      • setJ

        public void setJ​(int j)
      • getQ

        public double getQ()
        Returns:
        the maxQ
      • setQ

        public void setQ​(double q)
      • setInfo

        public void setInfo​(int j,
                            double q)
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • compareTo

        public int compareTo​(HeapNodeFG that)
        Compare this HeapNode to that HeapNode. We want before means higher Q, then smaller j
        Specified by:
        compareTo in interface java.lang.Comparable<HeapNodeFG>
        Parameters:
        that - the HeapNode to compare this to
        Returns:
        -1 if this goes before, 0 if they are equal, 1 if that goes before
      • compareToQ

        public int compareToQ​(HeapNodeFG that)